package hanjia;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * Description:
 * Author:    Dane
 * CreateTime:2025/2/17-下午5:38
 * Since  :   1.0
 * Version:   1.0
 */
public class LeetCode435 {

    public int findMinArrowShots(int[][] intervals) {

        Arrays.sort(intervals, (a, b) -> Integer.compare(a[0], b[0]));
        int result=0;
        for (int i=1;i<intervals.length;i++){
            if (intervals[i][0]>intervals[i-1][1]){
                result++;
            }else {
                intervals[i][1]=Math.min(intervals[i-1][1], intervals[i][1]);

            }



        }
        return result+1;




    }
    public int eraseOverlapIntervals(int[][] intervals) {

    }



}
